<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<h1>新增产品</h1>
	<hr />
	<ul style="color: red;">
		<c:forEach items="${errors }" var="error">
			<li>${error }</li>
		</c:forEach>
	</ul>

	<form action="../product/add" method="post"
		enctype="multipart/form-data">
		<ul style="list-style: none">
			<li>名称：<input type="text" name="name" value="${product.name }" /></li>
			<li>描述：<input type="text" name="description"
				value="${product.description }" /></li>
			<li>价格：<input type="text" name="price" value="${product.price }" /></li>
			<li>类别： <select name="categoryId">
					<c:forEach items="${categories }" var="category">
						<option
							${product.categoryId eq category.id  ? "selected='selected'" : "" }
							value="${category.id }">${category.name }</option>
					</c:forEach>
			</select>
			<li>图片：<input type="file" name="image"
				value="${produtct.iamge }" /></li>
		</ul>
		<input type="submit">
	</form>
	<hr />
	<a href="../product/list">返回</a>
</body>
</html>